package com.hqq.pack6;
/**
 * 学习pointCut注解
 */


import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
public class MyAspect {


    @AfterThrowing(value = "myPointCut()",throwing = "e")
    public void myAfterThrowing(Exception e){

        System.out.println("异常通知有fnally"+e.getMessage());
        //异常通知/ by zero

    }

    @After(value = "myPointCut()")
    public void myAfterThrowing(){

        System.out.println("执行最终通知 相当于finally");
        //异常通知/ by zero

    }

    @Pointcut(value = "execution(* *..SomeServiceImpl.doAfter(..))")
    private void myPointCut(){

    }


}
